<%@ page import="java.sql.*" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=0.5">
    <title>
        购物界面
    </title>
    <link href="https://at.alicdn.com/t/c/font_4090357_z2qpnic06um.css" rel="stylesheet">
    <link href="https://at.alicdn.com/t/c/font_4156699_i9rfozb6ac.css" rel="stylesheet">
    <link href="CSS/Shop.css" rel="stylesheet">
</head>
<body>
<h1>
    <a href="https://www.gov.cn/xinwen/2022-10/16/content_5718884.htm"><img src="photo/img_3.png" width="1450px"></a>
</h1>
<div style="top: 65%;left: 75%;position: fixed; height:30%">
    <div class="menu active">
        <div class="btn"><i class="iconfont icon-add"></i></div>
        <span id="homeButton" style="--i:0;--clr: #ff2972;" onclick="function scrollToTop(){
            window.scrollTo({
            top:0,behavior:'smooth'
            });
        }scrollToTop()">
      <i class="iconfont icon-home"></i>
    </span>
        <span id="moreButton" style="--i:1;--clr: #fee800;" onclick="scrollToTarget()">
      <i class="iconfont icon-more"></i>
    </span>
        <span id="giftButton" style="--i:2;--clr: #04fc43;">
      <i class="iconfont icon-gift"></i>
    </span>
        <span id="settingButton" style="--i:3;--clr: #fe00f1;" onclick="toggleMode()">
      <i class="iconfont icon-setting"></i>
    </span>
        <span id="messageButton" style="--i:4;--clr: #00b0fe;">
      <i class="iconfont icon-message"></i>
    </span>
        <span id="cartButton" onclick=window.parent.location.href="shopcar.jsp" style="--i:5;--clr: #fea600;">
      <i class="iconfont icon-cart"></i>
    </span>
        <span id="moneyButton" style="--i:6;--clr: #a529ff;">
      <i class="iconfont icon-money"></i>
    </span>
        <span id="starButton" style="--i:7;--clr: #01bdab;">
      <i class="iconfont icon-star"></i>
    </span>
    </div>
</div>
<table>
    <tr>
        <th style="width: 100px;height: 120px">
            <img src="photo/LF5.png" style="height: 120px;">
        </th>
        <th style="padding-left: 50px">
            <div style="padding-left: 408px">
                <form action="SearchProductOfShopping" method="get">
                    <div class="searchBar">
                        <div class="img1"><i class="iconfont icon-sousuoxiao"></i></div>
                        <div class="textInput">
                            <input class="inp" placeholder="请输入搜索关键字" type="text" name="searchKeyword"
                                   style="color: #121212;">
                            <button class="goBtn" type="submit">搜索</button>
                            <div class="clear"><i class="iconfont icon-close"></i></div>
                        </div>
                    </div>
                </form>
            </div>
            <br>
            <button onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                百亿补贴
            </button>
            <button onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                百亿补贴
            </button>
            <button onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                万人团购
            </button>
            <button onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                天天特卖
            </button>
            <button onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                办公用品
            </button>
            <button onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                有奖竞猜
            </button>
            <button onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                活动优惠
            </button>
        </th>
        <th>
        <th style="width: 100px;height: 120px">
            <img src="photo/LF6.png" style="height: 120px;width: 250px;">
        </th>
        </th>
        <th>
            <div class="nav h" style="  top: -6px;">
                <!-- 菜单切换部分 -->
                <div class="toggle">
                    <span></span>
                </div>
                <!-- 列表部分 -->
                <ul>
                    <li style="--i:0">主菜单</li>
                    <li onclick="function ShoppingCart() {
            window.location.href='shopcar.jsp';
        }
        ShoppingCart()" style="--i:1">购物车
                    </li>

                    <li onclick="function account() {
            window.location.href='LoginRegisterPage.jsp';
        }
        account()" style="--i:2">账户

                    <li onclick="function about() {
            window.location.href='upload.html';
        }
        about()" style="--i:3">关于
                    <li onclick="function set() {

            window.location.href='upload.html';
        }
       set()" style="--i:4">设置
                </ul>
            </div>
        </th>
        <%--        <button onclick="toggleMode()">Switch Mode</button>--%>
    </tr>
</table>
<a href="http://www.mofcom.gov.cn/article/zt_ztjy2023/fbdt/202306/20230603413734.shtml"><img src="photo/img_8.png"
                                                                                             width="1450px"></a>

<table>
    <tr style="border: none;">
        <td class="cebian button" style="width: 20%;">
            <ul>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    家用电器
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    手机、数码、通信
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    电脑、办公
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    家居、家具、家装、厨具
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    男装、女装、童装、内衣
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    个户化妆、清洁用品、宠物
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    鞋靴、箱包、珠宝、奢侈品
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    运动户外、钟表
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    汽车、汽车用品
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    母婴、玩具乐器
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    食品、酒类、生鲜、特产
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    医药保健
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    图书、音像、电子书
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    彩票、旅行、充值、票务
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    理财、众筹、白条、保险
                </li>
            </ul>
        </td>

        <td style="width:60%">
            <iframe src="HTML/ShopHead.html" height=675px width=95%
                    style="padding-left: 30px;color: transparent"></iframe>
        </td>
        <td class="cebian" style="padding-right:20px">
            <ul>

                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    购物指南
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    购物流程
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    会员介绍
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    会员介绍
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    生活旅行/团购
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    常见问题
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    大家电
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    服装城
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    美妆馆
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    传智超市
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    全球购
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    全球购
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    闪购
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    团购
                </li>
                <li onclick="window.location.href='https://pro.jd.com/mall/active/2vx2zyXR2KhRouYS6LrSEdnLF1P5/index.html'">
                    拍卖
                </li>
            </ul>
        </td>
    </tr>
</table>
<%--<a href="http://www.mofcom.gov.cn/article/zt_ztjy2023/fbdt/202306/20230603413734.shtml"><img src="photo/img1_20160310.png" width="850px" style="text-align: center" height="150px"></a>--%>
<div class="product-container">
    <%
        String url = "jdbc:mysql://localhost:3306/course_design";
        String username = "root";
        String password = "123456";
        Connection conn = null;
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            conn = DriverManager.getConnection(url, username, password);
            if (conn != null) {
                Statement stmt = conn.createStatement();
                String sql = "SELECT * FROM products";
                ResultSet rs = stmt.executeQuery(sql);
                String productName1 = null;
                int counter = 0; // 计数器，用于判断每行显示的个数
                while (rs.next()) {
                    // 检索其他产品细节的现有代码
                    String productName = rs.getString("pname");
                    String productStock = rs.getString("pstock"); // 添加获取产品库存的代码
                    if (productName.length() > 30) {
                        productName1 = productName.substring(0, 30) + "...";
                    }
                    String productDetail = rs.getString("Product_detail");
                    String productUrl = rs.getString("url");
                    double productPrice = rs.getDouble("pprice");
    %>

    <div class="product-item">
        <a href="<%= productDetail %>" target="_blank">
            <img src="<%= productUrl %>" alt="<%= productName %>">
        </a>
        <h3 title="<%= rs.getString("pname") %>"><%= productName1 %></h3>
        <p>库存: <%= productStock %></p> <!-- Add the product stock here -->
        <div style="text-align: center;font-size: 22px">价格：￥<%= productPrice %></div>
        <div style="text-align: center;font-size: 15px; text-decoration: line-through;">原价：<%=productPrice - productPrice / 5%></div>
        <div style="text-align: center;">
            <button onclick="dropAndRiseAnimation('<%= productName %>',this)">加入购物车</button>
        </div>
        <div id="animationBox">
            <p id="animationText"></p>
        </div>
    </div>
    <%
        counter++;
        // 如果已经显示了5个商品，则换行
        if (counter % 5 == 0) {
    %>
</div>
<div class="product-container">
    <%
                    }
                }
                rs.close();
                stmt.close();
            } else {
                System.err.println("数据库连接失败");
            }
        } catch (Exception e) {
            e.printStackTrace(System.err);
        } finally {
            try {
                if (conn != null) {
                    conn.close();
                }
            } catch (SQLException e) {
                e.printStackTrace(System.err);
            }
        }
    %>
</div>
<table id="moreTable">
    <tr>
        <td class="cebian3" style="width: 15%;">
            <h5>购物指南</h5>
            <ul>
                <li>
                    <a href="//help.jd.com/user/issue/list-29.html" target="_blank" rel="noopener noreferrer">
                        购物流程
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/list-151.html" target="_blank" rel="noopener noreferrer">
                        会员介绍
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/list-297.html" target="_blank" rel="noopener noreferrer">
                        生活旅行
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue.html" target="_blank" rel="noopener noreferrer">
                        常见问题
                    </a>
                </li>

                <li>
                    <a href="//help.jd.com/user/custom.html" target="_blank" rel="noopener noreferrer">
                        联系客服
                    </a>
                </li>
            </ul>
        </td>
        <td class="cebian3" style="width: 15%;">
            <h5>配送方式</h5>
            <ul>
                <li>
                    <a href="//help.jd.com/user/issue/list-81-100.html" target="_blank" rel="noopener noreferrer">
                        上门自提
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/list-81.html" target="_blank" rel="noopener noreferrer">
                        211限时达
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/list-82.html" target="_blank" rel="noopener noreferrer">
                        配送服务查询
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/109-188.html" target="_blank" rel="noopener noreferrer">
                        配送费收取标准
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/list-175.html" target="_blank" rel="noopener noreferrer">
                        东风快递 使命必达
                    </a>
                </li>
            </ul>
        </td>
        <td class="cebian3" style="width: 15%;">
            <h5>支付方式</h5>
            <ul>
                <li>
                    <a href="//help.jd.com/user/issue/list-172.html" target="_blank" rel="noopener noreferrer">
                        货到付款
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/list-173.html" target="_blank" rel="noopener noreferrer">
                        在线支付
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/list-176.html" target="_blank" rel="noopener noreferrer">
                        分期付款
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/list-175.html" target="_blank" rel="noopener noreferrer">
                        公司转账
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/list-175.html" target="_blank" rel="noopener noreferrer">
                        我给你钱行不行
                    </a>
                </li>
            </ul>
        </td>
        <td class="cebian3" style="width: 15%;">
            <h5>售后服务</h5>
            <ul>
                <li>
                    <a href="//help.jd.com/user/issue/list-112.html" target="_blank" rel="noopener noreferrer">
                        售后政策
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/list-132.html" target="_blank" rel="noopener noreferrer">
                        价格保护
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/130-978.html" target="_blank" rel="noopener noreferrer">
                        退款说明
                    </a>
                </li>
                <li>
                    <a href="//myjd.jd.com/repair/repairs.action" target="_blank" rel="noopener noreferrer">
                        返修/退换货
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/list-50.html" target="_blank" rel="noopener noreferrer">
                        取消订单
                    </a>
                </li>
            </ul>
        </td>
        <td class="cebian3" style="width: 15%;">
            <h5>特色服务</h5>
            <ul>
                <li>
                    <a href="//1paipai.jd.com/" target="_blank" rel="noopener noreferrer">
                        夺宝岛
                    </a>
                </li>
                <li>
                    <a href="//help.jd.com/user/issue/list-134.html" target="_blank" rel="noopener noreferrer">
                        DIY装机
                    </a>
                </li>
                <li>
                    <a href="//fuwu.jd.com/" target="_blank" rel="noopener noreferrer">
                        延保服务
                    </a>
                </li>
                <li>
                    <a href="//o.jd.com/market/index.action" target="_blank" rel="noopener noreferrer">
                        京东E卡
                    </a>
                </li>
                <li>
                    <a href="//mobile.jd.com/" target="_blank" rel="noopener noreferrer">
                        京东通信
                    </a>
                </li>
            </ul>
        </td>
    </tr>
</table>
<div><img src="photo/监督.png"><img src="photo/police.png"><img src="photo/10015105.png" width=400px></div>
<div><img src="photo/header-title.png" width=450px><img src="photo/logo.png" width=600px><img src="photo/h_logo0625.png"
                                                                                              width=400px></div>
<div class="foot" style="color: black"><p><span class="foot"><a
        href="https://huodong.taobao.com/wow/tbhome/act/about-home"
        rel="noopener noreferrer"
        data-spm-anchor-id="a21t4m.27981689.1997523009.28">关于Lin_Felix</a>
        </span>
    <span><a
            href="https://pro.taobao.com/index.htm" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.29">营销中心</a></span>
    <span><a
            href="https://taotian.jubao.alibaba.com" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.30">廉正举报</a></span>
    <span><a
            href="https://consumerservice.taobao.com/" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.31">联系客服</a></span>
    <span><a
            href="https://open.taobao.com/"
            rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.32">开放平台</a></span>
    <span><a
            href="https://talent.taotian.com/" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.33">诚征英才</a></span>
    <span><a
            href="https://consumerservice.taobao.com/contact-us" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.34">联系我们</a></span>
    <span><a
            href="https://terms.alicdn.com/legal-agreement/terms/suit_bu1_taobao/suit_bu1_taobao201703241622_61002.html"
            rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.35">隐私权政策</a></span>
    <span><a
            href="https://terms.alicdn.com/legal-agreement/terms/suit_bu1_taobao/suit_bu1_taobao201811121436_80276.html"
            rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.36">法律声明</a></span>
    <span><a
            href="https://ipp.alibabagroup.com/" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.37">知识产权</a></span>
    <span><a
            href="https://terms.alicdn.com/legal-agreement/terms/suit_bu1_taobao/suit_bu1_taobao202105131215_57739.html"
            rel="noopener noreferrer" data-spm-anchor-id="a21t4m.27981689.1997523009.38">不当竞争举报</a></span>
    <br><em>©
        2003-现在 Lin_Felix 版权所有</em></p>
    <p><span>增值电信业务经营许可证：粤A2-20080224</span><br><span>增值电信业务经营许可证（跨地区）： B2-20150210</span><br><span>粤网文【2022】0403-017号</span><br><span>粤江省网络食品销售第三方平台提供者备案：粤网食A33010001</span><br><br>
    </p>
    <p>
        <span>互联网药品信息服务资格证书（粤）-经营性-2023-0008</span><br><span>短消息类服务接入代码使用证书：号【2016】00154-A01</span><br><span>信息网络传播视听许可证：1109364号</span><br><span>出版物网络交易平台服务经营备案号：新出发粤备字第002号</span><br>
    </p>
    <p><span><a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33010002000078"
                rel="noopener noreferrer" data-spm-anchor-id="a21t4m.27981689.1997523009.39"><span class="tb-footer-mod"
                                                                                                   style="background-position: -861px 0px; width: 20px; height: 20px; background-image: url('http://www.mps.gov.cn/');"></span>粤公网安备 33010002000078号</a></span><br><span><a
            href="http://beian.miit.gov.cn/" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.40">粤B2-20080224-1</a></span><br><span>广播电视节目制作经营许可证（粤）字第01012号</span><br><span>市场名称登记证：工商网市字3301004120号</span><br><span>医疗器械网络交易服务第三方平台备案：（粤）网械平台备字[2018]第00004号</span><br><span><a
            href="mailto:jubao.tb@service.taobao.com" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.41">互联网违法和不良信息举报电话：0571-81683755 jubao.tb@service.taobao.com</a></span><br><span><a
            href="https://www.shdf.gov.cn/" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.42">中国扫黄打非网</a></span><br><span><a
            href="https://jbts.mct.gov.cn/" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.43">全国文化和旅游市场网上举报投诉处理系统</a></span><br><span><a
            href="https://www.12315.cn/" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.44">全国12315平台</a></span><br><span><a
            href="http://www.zjjubao.com/" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.45">粤江省互联网违法和不良信息举报中心</a></span><br><span><a
            href="https://jubao.taobao.com/" rel="noopener noreferrer"
            data-spm-anchor-id="a21t4m.27981689.1997523009.46">全网举报</a></span><br><span>营业性演出许可证：粤演经20213300000069</span><br><br>
    </p></div>
<script src="JavaScript/Shop.js">

</script>
</body>
</html>